<script>
    $(document).ready(function () {
        $('.asyncdata').click(function () {
            var id = $(this).attr('id');
            var key = {
              sm_sub_modulo_id:id  
            };
            $.ajax({
                url: "<?= base_url('xpanel/saveDataMateriales') ?>",
                type: 'POST',
                data: key,
                success: function (msg) {
                    window.location.href = "<?=base_url('xpanel/materiales.mti')?>";
                }
            });
        });
    });
</script>

<!--<link rel="stylesheet" type="text/css" href="<?= base_url("assets/css/$e_name_imagen")?>.css">-->
<!-- Sidebar -->
<div id="sidebar">

    <div class="sidebar-tabs">
        <ul class="tabs-nav two-items">
            <li><a href="#general" title=""><i class="icon-reorder"></i></a></li>
            <li><a href="#stuff" title=""><i class="icon-cogs"></i></a></li>
        </ul>

        <div id="general">

            <!-- Sidebar user -->
            <div class="sidebar-user widget header_logo">
                <div class="navbar"><div class="navbar-inner"><h6><?= ucwords($em_nombre) ?></h6></div></div>
                <br /><h5>Una plataforma de</h5>
                <div class="menu_logo"><img id="elogo" src="<?= base_url('assets/img/logos/logoIc')?>.png" alt="" /></div>
                <br /><h5>Para</h5>
                <div class="menu_logo"><img id="dlogo" src="<?= base_url("assets/img/logos/$e_name_imagen")?>.png" alt="" /></div>
            </div>
            <!-- /sidebar user -->

            <!-- Main navigation <?= ($place == 'xpanel') ? 'class="active"' : '' ?>  -->
            <ul class="navigation widget">
                <li class="active"><a href="<?= base_url('xpanel.mti') ?>" title=""><i class="icon-home"></i>XPANEL</a></li>
                <?php foreach($ModConSubM as $name => $m){ ?>
                <li><a class="expand" title="" ><i class="icon-briefcase"></i><?= $name ?></a>
                    <ul>
                    <?php foreach($m as $sm) {?>
                        <li><a href="#" title="" class="asyncdata" id="<?= $sm->sm_sub_modulo_id ?>"><?= $sm->sm_nombre ?></a></li>
                    <?php }?>
                    </ul>
                </li>
                <?php } ?>
            </ul>
            <!-- /main navigation -->

        </div>

        <div id="stuff">

            <!-- Datepicker -->
            <div class="widget">
                <h6 class="widget-name"><i class="icon-calendar"></i>Calendario</h6>
                <div class="inlinepicker datepicker-liquid"></div>
            </div>
            <!-- /datepicker -->
        </div>

    </div>
</div>
<!-- /sidebar -->